package com.hejing.test;

import com.hejing.my_utils.MyUtils;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;

/**
 * ClassName: test01
 * Package: com.hejing.test
 * Description:
 *
 * @Author: HeJing
 * @Create: 2023-05-31 20:50
 * @Version: 1.0
 */
public class test01 {
    public static void main(String[] args) throws ParseException {
        System.out.println(MyUtils.keepSomeDecimalForNum(13.231322, 1));
        String strNowDate = MyUtils.nowDate2String("yyyy-MM-dd HH:mm:ss");
        System.out.println(strNowDate);
        System.out.println();
        String strDate = "20131221 05:45:43";
        String pattern = "yyyyMMdd HH:mm:ss";
        Date date = MyUtils.string2Date(pattern, strDate);
        System.out.println(date);
        System.out.println();
        Calendar calendar = MyUtils.date2Calendar(new Date());
        System.out.println(calendar.get(Calendar.YEAR));
        System.out.println(calendar.get(Calendar.MONTH) +1);
        System.out.println(calendar.get(Calendar.DAY_OF_MONTH));
        System.out.println();
        System.out.println("今天是星期"  + MyUtils.getDayOfWeek(new Date()));

    }
}






















